Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
Is there a "limit" to Task.WhenAll?

If I need to perform IO-operations in a loop, I can create the Tasks and them await them all. Something like this:

var tasks = new List<Task>();
for (var dataToProcess in listOfData) {
    tasks.Add(DoSomeIOAsync(dataToProcess));
}

await Task.WhenAll(tasks);

How can I reason about what a reasonable number of dataToProcess in listOfData is?

If DoSomeIOAsync is async, then the thread used would be returned while waiting for the IO. So no risk for thread pool starvation I guess?

Is it the overhead of having a large amount of Task state machines in memory that might be a problem?

Are there some guidelines that I can use to reason about this?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!